﻿#ifndef ELK_BROWSER_APP_H
#define ELK_BROWSER_APP_H

#include "elk_application.h"
#include "include/cef_app.h"

class ElkBrowserApp : public CefApp, public CefBrowserProcessHandler
{
public:
    explicit ElkBrowserApp(ElkApplication *elk_application);
    ~ElkBrowserApp();

    bool Initialize();
    void ShutDown();
    void DoMsgLoopWork();

private:
    // CefApp methods:
    virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() OVERRIDE {
        return this;
    }

    // CefBrowserProcessHandler methods:
    virtual void OnContextInitialized() OVERRIDE;
    virtual void OnScheduleMessagePumpWork(int64 delay_ms) OVERRIDE;

private:
    ElkApplication *elk_application_ = nullptr;
    IMPLEMENT_REFCOUNTING(ElkBrowserApp);
};

#endif // ELK_BROWSER_APP_H
